import Vue from 'vue'
import Router from 'vue-router'

// 首页
import home from '../view/home.vue'

Vue.use(Router)

export default new Router({
  // mode: 'hash',
  routes: [
    // 首页
    {
      path: '/',
      name: 'home',
      component: home,
      meta: {
        istrue: true
      }
    },
    // 目的地
    {
      path: '/dest',
      name: 'dest',
      component: () => import('../view/destination.vue'),
      meta: {
        istrue: true
      }
    },
    // 目的地详情页
    {
      path: '/dest/detail',
      name: 'destdetail',
      component: () => import('../view/destDetail.vue'),
      meta: {
        istrue: true
      },
    },
    // 车票
    {
      path: '/ticket',
      name: 'ticket',
      component: () => import('../view/ticket.vue'),
      meta: {
        istrue: true
      }
    },
    // 机票详情页
    {
      path: '/ticket/detail',
      component: () => import('../view/ticketDetail.vue'),
      meta: {
        istrue: true
      }
    },
    {
      path: '/ticket/order',
      component: () => import('../view/trickOrder.vue'),
      meta: {
        istrue: true,
        login: true,
      }
    },
    //酒店
    {
      path: '/hotel',
      component: () =>
        import('../view/hotel'),
      meta: {
       // keepAlive: false,
        //login: true,
        title: 'home',
        istrue: true
      }
    },
    // 酒店列表
    {
      path: '/listHotel/:title',
      component: () =>
        import('../view/hotelList.vue'),
      meta: {
        istrue: true
      }

    },
    // 酒店详情
    {
      path: '/detailHotel/:id',
      component: () =>
        import('../view/hotelDetail.vue'),
      meta: {
        istrue: true
      }

    },
    // 社区
    {
      path: '/community',
      name: 'community',
      component: () => import('../view/community.vue'),
      meta: {
        istrue: true
      }
    },

    // 登录注册
    {
      path: '/login',
      name: 'login',
      redirect: '/login/login',
      component: () => import('../view/loginRegis.vue'),
      children: [
        {
          path: '/login/login',
          name: 'login',
          component: () => import('../components/loginRegister/login.vue')
        },
        {
          path: '/login/register',
          name: 'register',
          component: () => import('../components/loginRegister/register.vue')
        },
        {
          path: '/login/find',
          name: 'find',
          component: () => import('../components/loginRegister/find.vue')
        }
      ]
    },

    //演出 
    {
      path: '/show',
      name: 'show',
      redirect: '/show/recom',
      component: () => import('../view/Yshow.vue'),
      meta: {
        istrue: true
      },
      children: [
        {
          path: '/show/recom',
          component: () => import('../components/Yshow/showAll.vue'),
          meta: {
            istrue: true
          },
        },
        {
          path: '/show/page/:index',
          component: () => import('../components/Yshow/showMx.vue'),
          meta: {
            istrue: true
          },
        }
      ]
    },
    {
      path: '/Yshow/detail',
      name: 'showdetail',
      component: () => import('../components/Yshow/showMxDetail.vue'),
      meta: {
        istrue: true
      },
    },
    //演出页搜索
    {
      path: '/ySearch',
      component: () => import('../components/Yshow/chilDetail/yanchuSearch.vue'),
      meta: {
        istrue: true
      },
    },

    // 个人中心
    {
      path: '/Mycenter',
      redirect: '/Mycenter/info',
      component: () => import('../view/Mycenter.vue'),
      meta: {
        istrue: true
      },
      children: [
        {
          path: '/Mycenter/info',
          component: () => import('../components/Mycenter/info.vue'),
          meta: {
            istrue: true,
            login: true,
            title: 'home'
          }
        },
        {
          path: '/Mycenter/notes',
          component: () => import('../components/Mycenter/notes.vue'),
          meta: {
            istrue: true,
            login: true,
          },
        },
        {
          path: '/Mycenter/order',
          component: () => import('../components/Mycenter/order.vue'),
          meta: {
            istrue: true,
            login: true,
          },
        },
        {
          path: '/Mycenter/collect',
          component: () => import('../components/Mycenter/collect.vue'),
          meta: {
            istrue: true,
            login: true,
          },
        }
      ]

    },
    // 路由错误跳转404
    {
      path: '*',
      component: () => import('../view/404.vue'),
      meta: {
        istrue: true
      },
    },
   //App下载
    {
      path:'/load',
      component:()=>import('../view/load.vue'),
      meta: {
        istrue: true
      },
    }
    // 滑动验证
    // {
    //   path: '/svg',
    //   name: 'svg',
    //   component: ()=>import('../commonality/Map.vue'),
    // }
  ]
})
